package com.bootdo.ocr.xfyun;

import com.bootdo.ocr.DpiType;
import com.bootdo.ocr.FileType;
import com.bootdo.ocr.xfyun.dto.XfYunOcrResult;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.junit.Test;

import java.io.IOException;
import java.util.List;


public class XfYunOcrServiceTest {

    protected Logger logger = Logger.getLogger(getClass());

    String apiKey = "069d150f9a866fcb923a528bfd7b88f6";
    String appId = "5d54bda4";
    XfYunOcrService service = new XfYunOcrService(apiKey, appId);

    @Test
    public void updateFileByDir() throws IOException {
        final List<XfYunOcrResult> xfYunOcrResults = service.validateFileByDirAndPattern("D:\\document\\mix", FileType.pdf, "GB", DpiType.D300);
    }
    @Test
    public void grouopForder() throws IOException {
        final List<XfYunOcrResult> xfYunOcrResults = service.validateFileByDir("D:\\document\\mix", FileType.pdf,  DpiType.D300);
        System.out.println(xfYunOcrResults);
    }
    @Test
    public void testLog() {
        PropertyConfigurator.configure("log4j.properties");
        logger.error("aaaaaaaaaaaaaaa");
    }
}